<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="function.asp" -->
<!-- #include file="comsub.asp" -->

<%
dim isObjRSid,isAllReplySize
isObjRSid=request("isObjRSid")
isAllReplySize=request("isAllReplySize")
Dim isElementById
isElementById=request("isElementById")

If isAllReplySize=0 Or isAllReplySize="" Then
    Str = "document.getElementById('Reply" &isObjRSid& "').innerHTML = ""<table width='100%' border='0' class='tdreply'><tr><td><b>޻ظ</b></td></tr></table>"";"
    Response.write str
    Response.End 
End If 

dim replyPage      
replyPage = Request("replyPage")
if replyPage="" or replyPage=0 then
    replyPage=1
else
    replyPage=cint(request("replyPage"))
end if

Dim str
    dim ReplyRS,Replysql
    set ReplyRS = Server.CreateObject("ADODB.Recordset")
    Replysql="select * from reply where Cstr(reply_id)='"&isObjRSid&"' order by id Asc"
    Replyrs.open Replysql,conn,1,1
        dim RowCount,totalPage,totalRecordcount
        if NOT (Replyrs.EOF And Replyrs.BOF) then
            Replyrs.pagesize=showlistok()
            RowCount=Replyrs.PageSize
            totalPage=Replyrs.pagecount
            Replyrs.AbsolutePage=replyPage
            totalRecordcount=Replyrs.recordcount
        end if
        Dim i
		If ReplyPage<=1 Then
		    i=0
		Else
		    i=(ReplyPage-1)*showlistok()
		End If 
        if replyList2(isObjRSid) Then
            Str = "document.getElementById('Reply" &isElementById& "').innerHTML = ""<center>"
            str = str & "<table width='100%' border='0' class='tdreply'>"
            str = str & "<tr>"
            str = str & "<td width='' align='center'><span class='fontsize'>ظ</span></td>"
            str = str & "<td width='18%' align='right''><span class='fontsize'>ظ</span></td>"
            str = str & "<td width='7%' align='right'><span class='fontsize'>С</span></td>"
            str = str & "<td width='20%' align='center'><span class='fontsize'>ظʱ</span></td>"
            str = str & "</tr>"
            DO WHILE NOT Replyrs.EOF AND RowCount>0
                RowCount = RowCount - 1
                i=i+1
                str = str & "<tr>"
                if request("replyPage")<>"" then     
                    str = str & "<td><b><a target='_blank' class='a2' href='11.asp?id="& isObjRSid &"&replyPage=" &ReplyPage& "&ReplyId=#"&Replyrs("ID")&"' title='"& Replyrs("reply_subject") &"'>" &i& "" &left(Replyrs("reply_subject"),20)& "</b></td>"
				else
                    str = str & "<td><b><a target='_blank' class=a2 href='11.asp?id="& isObjRSid &"&ReplyId=#"&Replyrs("ID")&"' title='"& Replyrs("reply_subject") &"'>" &i& "" &left(Replyrs("reply_subject"),20)& "</b></td>"
                end if
                if Replyrs("reply_human")<>"" then
                    str = str & "<td align='right'>"&Replyrs("reply_human")&"</td>"
                else
                    str = str & "<td align='right'>(ο)</td>"
                end if
                str = str & "<td align='right'><span class='fontsize'>"&Replyrs("contentsize2")&"</span></td>"
                str = str & "<td align='center'><span class='fontsize'>"&Replyrs("reply_time")&"</span></td>"
                str = str & "</tr>"
                Replyrs.movenext        
            Loop
            If replyList2(isObjRSid) Then
                str = str & "<tr>"
                    str = str & "<td colspan='4'>"
                          str = str & "<br>"
                          str = str & "<table border='1' align='center' width='100%' style='background-color:#D6D3CE'>"
                               str = str & "<tr>"
                                    str = str & "<td>"
                                        call pages(isTotalRecordcount(isObjRSid),isTotalPage(isObjRSid),ReplyPage,isElementById)
                                    str = str & "</td>"
                               str = str & "</tr>"
                          str = str & "</table>"
                          str = str & "<br>"
                    str = str & "</td>"
                str = str & "</tr>"
            End If 
            str = str & "<span class='tdreply'>&nbsp;ܹ&nbsp;<font color='red'>" &totalRecordcount& "</font>&nbsp;ظ&nbsp;&nbsp;ϼƴСΪ<font color='red'>" &FileContentSize2(isAllReplySize)& "</font></span>"
			str = str & "</table>"";"
            Response.write str
        end if
    Replyrs.close 
    set Replyrs=nothing 

Call conn_Nothing()

sub pages(totalRecordcount,totalPage,replyPage,isElementById)
    if totalRecordcount<>0 then
        dim currid1,currid2
        if totalPage>=10 then
            if replyPage mod 10=0 then
                 currid1=replyPage
                 currid2=replyPage-9
             Else
                 if totalPage mod 10=0 then 
                     currid1=int(replyPage/10)*10+10
                 else 
                     if int(replyPage/10)=int(totalPage/10) then currid1=(totalPage/10)*10 else currid1=int(replyPage/10)*10+10
                 end if
                 currid2=int(replyPage/10)*10+1
             end if
         else 
             currid1=totalPage mod 10
             currid2=int(replyPage/10)*10+1
         end if

         str = str & "<table align='left'>"
              str = str & "<tr><td>"
                       if totalPage>1 Then
                              If replyPage=totalPage or replyPage<>1 Then 
                                  dim PrwePage
                                  PrwePage=replyPage-1
							      str = str & "<A class='a1' HREF='javascript:showReplyPage2("&PrwePage&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'><font size=4>һҳ</font></A>"
							  End If  
                        End If          
               str = str & "</td></tr>"
         str = str & "</table>"

         str = str & "<table border='0' align='left'>"
               str = str & "<tr><td>"
                       str = str & "<FONT face='webdings' size='2'>"
                       if replyPage=1 then
                               str = str & "<span style='color:#FF0000'>9</span>"
                       Else
                               str = str & "<a class='a2' HREF='javascript:showReplyPage2(1,"&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'>9</a>"
					   end if
                       if Page>10 Then
                               str = str & "<a class=a2 HREF='javascript:showReplyPage2("&currid2-1&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'>7</a>"
					   end if
                       str = str & "</FONT>"
                       str = str & "&nbsp;"
                       str = str & "<strong>"
                       for i=currid2 to currid1
                            if replyPage=i then 
	                             str = str & "<font color='red' size='4'>" &i& "</font>"
                            else
                                 str = str & "<FONT size='2'>"
                                 str = str & "<a class='a2' HREF='javascript:showReplyPage2("&i&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'>"
										str = str & i
                                 str = str & "</a>"
                                 str = str & "</FONT>"
                            end if
                            str = str & "&nbsp;"
                       Next
                       str = str & "</strong>"
                       str = str & "<FONT face='webdings' size='2'>"
                       if currid1<totalPage Then
                             str = str & "<a class='a2' HREF='javascript:showReplyPage2("&currid1+1&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'>8</a>"
					   end If
                       if replyPage=totalPage then
                             str = str & "<span style='color:#FF0000'>:</span>"
                       Else
                             str = str & "<a class='a2' HREF='javascript:showReplyPage2("&totalPage&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'>:</a>"
					   end If
                       str = str & "</FONT>"
               str = str & "</td></tr>"
         str = str & "</table>"

         str = str & "<table align='left'>"
               str = str & "<tr><td>"
                        if totalPage>1 Then
                            If replyPage=1 or totalPage>replyPage Then
                                 dim NextPage
                                 NextPage=replyPage+1
                                 str = str & "<A class='a1' HREF='javascript:showReplyPage2("&NextPage&","&Request("isObjRSid")&","&Request("isAllReplySize")&","&Request("isElementById")&");'><font size=4>һҳ</font></A>"
							 End If
                        End If
                 str = str & "</td></tr>"
         str = str & "</table>"

         str = str & "<table align='right'>"
                 str = str & "<tr><td>"
                       if replyPage>totalPage then
                            replyPage=totalPage
                       end if
                      str = str & "<font size='2'>ҳΣ<font color='red'><b>"& replyPage &"</b></font>/<b>"& totalPage &"</b>ҳ ,<b>"& totalRecordcount &"</b></font>"
                      str = str & "&nbsp;&nbsp;&nbsp;&nbsp;"
                str = str & "</td></tr>"
         str = str & "</table>"
    end if
end sub

%>
